//2009/08/11 01:41:07
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

using namespace std;

class BoxLoader
{
public:
    int mostItems(int boxX, int boxY, int boxZ, int itemX, int itemY, int itemZ)
    {
		int mmax = 0;
		mmax = max(mmax, (boxX/itemX) * (boxY/itemY) * (boxZ/itemZ));
		mmax = max(mmax, (boxX/itemX) * (boxY/itemZ) * (boxZ/itemY));
		mmax = max(mmax, (boxX/itemY) * (boxY/itemX) * (boxZ/itemZ));
		mmax = max(mmax, (boxX/itemY) * (boxY/itemZ) * (boxZ/itemX));
		mmax = max(mmax, (boxX/itemZ) * (boxY/itemY) * (boxZ/itemX));
		mmax = max(mmax, (boxX/itemZ) * (boxY/itemX) * (boxZ/itemY));
		return mmax;
    }
};
